#ifndef __APP_DESKTOP_WINCTL_H
#define __APP_DESKTOP_WINCTL_H

#include<gui.h>
#include<sys/list.h>

#define WINCTL_ICON_PATH_DEFAULT "/system/icons/default.png"

#define WINCTL_ICON_SIZE 36
#define WINCTL_SIZE_DEFAULT (WINCTL_ICON_SIZE+4)

#define WINCTL_BACKCOLOR GUI_RGB(40,40,40)
#define WINCTL_ACTIVECOLOR GUI_RGB(80,80,80)

typedef struct 
{
    bool ishidden; //window hidden
    bool isfocus; //window focus
    gui_spirit_t *button; //button 
    int winid; //current window
    list_t list; //winctl list 
}winctl_t;

extern winctl_t *winctl_last;

winctl_t *winctl_create(int winid);
int winctl_destroy(winctl_t *winctl);
int winctl_destroy_all();
winctl_t *winctl_find(int winid);
void winctl_get_focus(winctl_t *winctl);
void winctl_lose_focus(winctl_t *winctl);
void winctl_set_icon(winctl_t *winctl,char *path);
void winctl_paint(winctl_t *winctl);

#endif 